from UIAutoTest.unittest_login.Service import Service
import unittest
from ddt import ddt, data, unpack
from UIAutoTest.unittest_login.Excel_Read import ReadExcel


# 单元测试类
@ddt
class WouniuLogin(unittest.TestCase):
    excelList = ReadExcel().get_excel_data('蜗牛登录测试', '第一张')  # 读取Excel中的数据

    # 登录测试用例方法
    @data(*excelList)  # 读取数据
    @unpack  # 将数据打散传参
    def test_login_a(self, accounts, pwd, code, msg):
        Service().sum(accounts, pwd, code)
        # 断言
        assert msg == "登录成功", "登录失败"
